﻿/**********************************************************************
 * @file   OperatorsJunctionPoint.h
 * @brief  点连接操作器
 * @author BaGuijun (baguijun@163.com)
 * @date   2024-11-12
 *********************************************************************/
#ifndef _OperatorsJunctionPoint_H
#define _OperatorsJunctionPoint_H

#include "FITK_Kernel/FITKCore/FITKOperatorRepo.h"
#include "OperatorsInterface/ParaWidgetInterfaceOperator.h"

namespace ModelOper
{
    /**
     * @brief  点连接操作器
     * @author BaGuijun (baguijun@163.com)
     * @date   2024-11-12
     */
    class OperatorsJunctionPoint :public EventOper::ParaWidgetInterfaceOperator
    {
        Q_OBJECT;
    public:
        /**
         * @brief    Construct a new Operators Open object
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        explicit OperatorsJunctionPoint() = default;
        /**
         * @brief    Destroy the Operators Open object
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        virtual ~OperatorsJunctionPoint() = default;
        /**
         * @brief    执行界面操作
         * @return   true     执行成功
         * @return   false     执行失败
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        virtual bool execGUI() override;
        /**
         * @brief    执行读入操作
         * @return   true     执行成功
         * @return   false     执行失败
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        virtual bool execProfession() override;
    private slots:
        ;
        /**
         * @brief    拾取结束槽函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void slotPickOverEvent();

    private:
        /**
         * @brief    创建连接点
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-22
         */
        void createJunctionPointOper(QList<int> pointList);
        /**
         * @brief    修改连接点
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-22
         */
        void editJunctionPointOper();
        /**
         * @brief    删除全部连接点的数据
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-22
         */
        void deleteBatchPointOper();
        /**
         * @brief    创建连接点
         * @param[i] points      连接有效点
         * @return   int         创建后的点id
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        int createJunctionPoint(QList<int>& points);
        /**
         * @brief    拾取数据提取
         * @param[i] pointIDs 
         * @param[o] subsys 
         * @return   bool
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-22
         */
        bool pickDataExtract(QList<int> pointIDs, QList<QPair<int, int>>& subsys);
    };

    // 按钮注册相关操作
    Register2FITKOperatorRepo(actionCreateJunctionPoint, OperatorsJunctionPoint);
    Register2FITKOperatorRepo(actionEditJunctionPoint, OperatorsJunctionPoint);
    Register2FITKOperatorRepo(actionDeleteBatchPoint, OperatorsJunctionPoint);
}

#endif